package net.sx.minemodule.mvp.activities;

import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.base.MyBaseFragmentActivity;

import net.sx.minemodule.R;
import net.sx.minemodule.databinding.MineActivityMineBrokerageBinding;
import net.sx.minemodule.mvp.presenters.MineBrokeragePresenter;

/**
 * 我的佣金
 * add shibo.zheng
 * 19/06/13
 */
@Route(path = ARouterPath.PATH_MINE_BROKERAGE)
public class MineBrokerageActivity extends MyBaseFragmentActivity<MineActivityMineBrokerageBinding, MineBrokeragePresenter> {
    private String brokerageType;

    @Override
    protected int getLayout() {
        return R.layout.mine_activity_mine_brokerage;
    }

    @Override
    protected void initEvent() {

    }

    @Override
    protected MineBrokeragePresenter getPresenter() {
        return null;
    }

    @Override
    protected void initToolBar(Bundle savedInstanceState) {
        super.initToolBar(savedInstanceState);
        setTitle("我的佣金");
        setTopRightButton("历史返佣记录", 0, v -> {
            brokerageType = "brokerageHistory";
            ARouter.getInstance().build(ARouterPath.PATH_RECORD_INFO).withString("recordInfoType", brokerageType).navigation();
        });
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);

        mBinding.brokerageInfo.setOnClickListener(v -> {
            brokerageType = "brokerageInfo";
            ARouter.getInstance().build(ARouterPath.PATH_RECORD_INFO).withString("recordInfoType", brokerageType).navigation();
        });

        mBinding.commentProblem.setOnClickListener(v -> ARouter.getInstance().build(ARouterPath.PATH_COMMON_PROBLEM).navigation());

    }
}
